package com.haiyangwang1.lesson2;

public class Employee {
    public String name; //姓名
    public String address; //邮寄地址
    public int SSN; //社保号
    public int number; //员工号
    public float salary; //年薪

    //邮寄支票
    public void mailCheck() {
        System.out.println("将员工" + this.name + "的支票寄到 " + this.address);
    }

//    //计算月薪
//    public float computePay() {
//        return (float) (this.salary / 12.0); //年薪制员工，一年12个月。
//    }
    @Override
    public boolean equals(Object x){
        if(x==null) return false;
        Employee e = (Employee) x;
        if (this.number == e.number){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public int hashCode(){
        return  this.number;
    }
}
